#ifndef FLOATING_TASK_H_
#define FLOATING_TASK_H_

#include <string>
#include <ctime>
#include "CommonConstant.h"

using namespace std;

// @author A0096955J

/* Class Name: FloatingTask
 *
 * This class models a floating task in TaskLine. It contains attributes that a typical task would contain.
 * It also acts as a super class to two subclasses DeadlineTask and TimedTask.
 *
 */
class FloatingTask{
public:
	// constructors
	FloatingTask(void);
	FloatingTask(string,string,string,string,int,int,int);

	// get attributes methods
	string getTitle();
	string getDescription();
	string getLocation();
	string getPerson();
	int getPriority();
	int getFinishedStatus();
	int getIndex();
	string getStringPriority();
	string getStringFinishedStatus();
	char getTaskType();

	// set attributes methods
	void setTitle(string);
	void setDescription(string);
	void setLocation(string);
	void setPerson(string);
	void setPriority(int);
	void setPriority(string);
	void setFinishedStatus(int);
	void setFinishedStatus(string);
	void setIndex(int);

	// contains all attributes of the Task in a string format
	virtual string taskInfomation();
	virtual string basicTaskInfomation();
	string optionalInfomation();
	virtual FloatingTask* clone() const;

	// interface
	// interface for timed task
	virtual string getStartTime(); // HHMM format
	virtual string getStartDate(); // DD/MM/YYYY format
	virtual string getEndTime(); // HHMM format
	virtual string getEndDate(); // DD/MM/YYYY format
	virtual string getFullStartDateInfo(); // day, DD month YYYY
	virtual string getFullEndDateInfo(); // day, DD month YYYY
	virtual time_t getStartTimeAndDate();
	virtual time_t getEndTimeAndDate();
	virtual void setStartTimeAndDate(time_t);
	virtual void setStartTimeAndDate(struct tm);
	virtual void setEndTimeAndDate(time_t);
	virtual void setEndTimeAndDate(struct tm);

	//interface for deadline task
	virtual	string getTime(); // HHMM format
	virtual string getDate(); // DD/MM/YYYY format
	virtual string getFullDateInfo(); // day, DD month YYYY
	virtual time_t getTimeAndDate();
	virtual struct tm getTimeAndDateTmFormat();
	virtual void setTimeAndDate(time_t);
	virtual void setTimeAndDate(struct tm);
	// destructors
	virtual ~FloatingTask(void);
protected:
	string title,description,location,person;
	int priority, // 0 for HIGH priority, 1 for MEDIUM priority, 2 for LOW priority
		finishedStatus, // 0 for NOT FINISHED, 1 for FINISHED
		index;
	char taskType; // 'f' for floating, 'd' for deadline and 't' for timed

	// internal methods not accessible to user
	string determinePriority();
	string determineFinishedStatus();
	string toUpperCase(string);
	int convertStringPriorityToInt(string);
	int convertStringFinishedStatusToInt(string);
	bool isEqualIgnoreCaseString(string, string);
};

#endif